class SongsController < ApplicationController
  include AuthenticatedSystem
  before_filter :login_required, :except => :view
  
  def new
    @song = Song.new
  end
  
  def create
    @song = Song.new(params[:song])
    @song.date = DateTime.now
    if @song.save
      flash[:notice] = "Song saved!"
      render :action => :new
    else
      flash[:notice] = "Error!"
      render :action => :new
    end
  end
  
  def view
    @song = Song.find(@params[:id])
  end
end
